<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean"%>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Manage User</title>
<link rel="stylesheet" type="text/css" href="css/FinalProjectCSS.css"/>
<script type="text/javascript" src="js/MasterJS.js"></script>
<script type="text/javascript">

</script>
</head>
<body>
	<center>
		<table width="100%" class="bodyTable boxShadow">

			<!-- Header -->
			<tr>
				<td colspan="2"><%@include file="/include/Header.jsp"%></td>
			</tr>

			<!-- Content -->
			<tr>
				<td rowspan="2" width="200px" class="navigationBox"><%@include file="/include/Navigation.jsp"%></td>
				<td align="left" class="headerBox blueBackground">User Management > 
				<a href="/WebFinalProject/Eclass.do">Manage User</a>
				 > Update User</td>
			</tr>
			<tr>
				<td align="center"  class="contentStyle"><br>
					<html:form action="/Eclass" method="post">
						<html:hidden property="task" name="eclassForm" />
						<html:hidden property="modelEclass.userid" name="eclassForm" />
						<html:hidden property="modelEclass.role" name="eclassForm" />
						<table border="0" class="boxShadow">
							<tr>
								<td colspan="6" align="center" class="formListStyle headerBox formHeaderBackground">Update User</td>
							</tr>
							<!-- <tr>
								<td colspan="3">&nbsp;</td>
							</tr> -->
							<logic:notEmpty name="eclassForm" property="modelEclass">
<%-- 								<logic:iterate id="listData" name="eclassForm" property="listUser"> --%>
									<tr>
										<td class="formListStyle leftAlign">User ID</td>
										<td class="formListStyle">:</td>
										<td class="formListStyle leftAlign"><bean:write name="eclassForm" property="modelEclass.userid"></bean:write></td>
										<logic:equal value="candidate" property="modelEclass.role" name="eclassForm">										
											<td class="formListStyle leftAlign" rowspan="2">Password</td>
											<td class="formListStyle" rowspan="2">:</td>
											<td class="formListStyle leftAlign" rowspan="2">
												<table title="reset password" class="buttonStyle" style="cursor: pointer; " onclick="javascript:flyToPage('resetPassword');">
													<tr>
														<td style="vertical-align:middle;"><img src="images/resetButton.png"/></td>
														<td style="vertical-align:middle;"><b>&nbsp;Reset Password&nbsp;</b></td>
													</tr>
												</table>
<!-- 												<input type="button" value="Reset Password" onclick="javascript:flyToPage('resetPassword');"> -->
											</td>
										</logic:equal>
										<logic:equal value="admin" property="modelEclass.role" name="eclassForm">
											<td class="formListStyle leftAlign" rowspan="2">Password</td>
											<td class="formListStyle" rowspan="2">:</td>
											<td class="formListStyle leftAlign" rowspan="2">
												<table title="reset password" class="buttonStyle" style="cursor: pointer; " onclick="javascript:flyToPage('resetPassword');">
													<tr>
														<td style="vertical-align:middle;"><img src="images/resetButton.png"/></td>
														<td style="vertical-align:middle;"><b>&nbsp;Reset Password&nbsp;</b></td>
													</tr>
												</table>
<!-- 												<input type="button" value="Reset Password" onclick="javascript:flyToPage('resetPassword');"> -->
											</td>										
										</logic:equal>
										<logic:notEqual value="candidate" property="modelEclass.role" name="eclassForm">
											<logic:notEqual value="admin" property="modelEclass.role" name="eclassForm">
												<td class="formListStyle" colspan="3" rowspan="2"></td>
											</logic:notEqual>
										</logic:notEqual>																				
									</tr>
									<tr>
										<td class="formListStyle leftAlign">Fullname</td>
										<td class="formListStyle">:</td>
										<td class="formListStyle leftAlign"><bean:write name="eclassForm" property="modelEclass.fullname"></bean:write></td>										
									</tr>
									<tr>
										<td class="formListStyle leftAlign">Email</td>
										<td class="formListStyle">:</td>
										<td class="formListStyle leftAlign" colspan="4"><bean:write name="eclassForm" property="modelEclass.email"></bean:write></td>										
									</tr>									
									<tr>
										<td class="formListStyle leftAlign" width="80px">Role</td>
										<td class="formListStyle" width="10px">:</td>
										<td class="formListStyle leftAlign" width="180px"><bean:write name="eclassForm" property="modelEclass.role"></bean:write></td>
										<td class="formListStyle leftAlign" width="80px">Last Login</td>
										<td class="formListStyle" width="10px">:</td>
										<td class="formListStyle leftAlign" width="180px"><bean:write name="eclassForm" property="modelEclass.lastlogin"></bean:write></td>
									</tr>
									<logic:notEqual value="<%=user.getUserid() %>" property="modelEclass.userid" name="eclassForm">
										<tr>
											<td class="formListStyle leftAlign">Active</td>
											<td class="formListStyle">:</td>
											<td class="leftAlign" style="vertical-align: middle;">
												<html:select property="modelEclass.active" name="eclassForm">
													<html:option value="YES">YES</html:option>
													<html:option value="NO">NO</html:option>
												</html:select>
											</td>
											<td class="formListStyle leftAlign">Logged In</td>
											<td class="formListStyle">:</td>
											<td class="leftAlign" style="vertical-align: middle;">
												<html:select property="modelEclass.isloggedin" name="eclassForm">
													<html:option value="YES">YES</html:option>
													<html:option value="NO">NO</html:option>
												</html:select>
											</td>
										</tr>
									</logic:notEqual>
									<tr>
										<td class="formListStyle leftAlign">Update User</td>
										<td class="formListStyle">:</td>
										<td class="formListStyle leftAlign"><bean:write name="eclassForm" property="modelEclass.usrupd"></bean:write></td>
										<td class="formListStyle leftAlign">Update Date</td>
										<td class="formListStyle">:</td>
										<td class="formListStyle leftAlign"><bean:write name="eclassForm" property="modelEclass.dtmupd"></bean:write></td>
									</tr>								
<%-- 								</logic:iterate> --%>
							</logic:notEmpty>
							<!-- <tr>
								<td colspan="3">&nbsp;</td>
							</tr> -->
							<tr>
								<td colspan="6" align="center">
									<table>
										<tr>
											<td align="right" class="formListStyle" width="50%">
												<table title="save" class="buttonStyle" style="cursor: pointer; width:100%;" onclick="javascript:save();">
													<tr>
														<td style="vertical-align:middle;"><img src="images/saveButton.png"/></td>
														<td style="vertical-align:middle;"><b>&nbsp;Save&nbsp;</b></td>
													</tr>
												</table>
											</td>
											<td align="left" class="formListStyle" width="50%">			
												<table title="cancel" class="buttonStyle" style="cursor: pointer; width:100%;" onclick="javascript:flyToPage('manageGroupClass');">
													<tr>
														<td style="vertical-align:middle;"><img src="images/cancelButton.png"/></td>
														<td style="vertical-align:middle;"><b>&nbsp;Cancel&nbsp;</b></td>
													</tr>
												</table>
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</html:form><br>
				</td>
			</tr>

			<!-- Footer -->
			<tr>
				<td align="center" colspan="2" class="headerBox blueBackground">&copy; OME. 2014. All Rights Reserved.</td>
			</tr>
		</table>
	</center>
</body>
</html>